package singleton;

/**
 * 静态内部类
 * 优点：懒加载，线程安全，效率高。
 * Created by thiswhyme on 2019/03/15.
 */
public class StaticInnerClassSingleton {

    private static class InnerSingleton {
        public static final StaticInnerClassSingleton INSTANCE = new StaticInnerClassSingleton();
    }

    private StaticInnerClassSingleton() {

    }

    public static StaticInnerClassSingleton getInstance() {
        return InnerSingleton.INSTANCE;
    }
}
